import React, { Component } from 'react';
import { List, NavBar, Card, Button, WhiteSpace, Flex, Icon, SearchBar, Switch, WingBlank } from 'antd-mobile';
import { Link } from "react-router-dom";
import { LogoutOutlined, StarFilled, ApiOutlined, CrownFilled, ClockCircleFilled, TagsFilled, MailFilled, PieChartFilled, ApiFilled } from '@ant-design/icons';

import UserHeader from './userName'

import AppPage from '../../container/AppPage'// 容器 解决 navbar

// import { Redirect } from 'react-router-dom';
// import './index.css'
const data = [{
    url: 'https://zos.alipayobjects.com/rmsportal/PZUUCKTRIHWiZSY.jpeg',
    id: '2121',
}, {
    url: 'https://zos.alipayobjects.com/rmsportal/hqQWgTXdrlmVVYi.jpeg',
    id: '2122',
}];
export default class UserPage extends Component {
    constructor(props) {
        super(props);
        this.state = {
            user: '',
            pwd: '',
            files: data,
            multiple: false,
        }
        this.register = this.register.bind(this)
        this.handleLogin = this.handleLogin.bind(this)
    }

    register() {
        this.props.history.push('/register');
    }

    handleLogin() {
        // this.props.login(this.props.state)

        this.props.history.push('/home/home');

    }

    render() {
        const Item = List.Item;
        return (
            <div style={{ backgroundColor: '#F5F5F9'}}>
                <NavBar>我的</NavBar>
                <AppPage>
                    <UserHeader></UserHeader>
                    <WhiteSpace size='lg'></WhiteSpace>

                    <List>
                        <Link to='collection'>
                            <Item
                                thumb={<TagsFilled style={{ color: '#00cec9', fontSize: 18 }}></TagsFilled>}
                                arrow="horizontal"
                                onClick={() => { }}
                                style={{ height: '50px' }}

                            >勋章管理</Item>
                            <Item
                                thumb={<StarFilled style={{ color: '#faad14', fontSize: 18 }} />}
                                arrow="horizontal"
                                onClick={() => { }}
                                style={{ height: '50px' }}

                            >我的收藏</Item>
                        </Link>
                        <Link to='collection'>
                            <Item
                                thumb={<ClockCircleFilled style={{ color: '#b2bec3', fontSize: 18 }} />}
                                arrow="horizontal"
                                onClick={() => { }}
                                style={{height:'50px'}}
                            >浏览历史</Item>
                        </Link>
                        <Link to='apply'>
                           
                        </Link>
                        {/* <Item
                            thumb={<PieChartFilled style={{ color: '#a29bfe', fontSize: 18 }} />}
                            arrow="horizontal"
                            onClick={() => { }}
                            platform="android"

                        >成绩小助手</Item> */}

                    </List>
                    <WhiteSpace size='lg'></WhiteSpace>

                    <List>
                        {/* <Item
                            thumb={<TagsFilled style={{ color: '#00cec9', fontSize: 18 }}></TagsFilled>}
                            arrow="horizontal"
                            onClick={() => { }}
                        >小贴士</Item> */}
                        <Item
                            thumb={<CrownFilled style={{ color: '#ff7675', fontSize: 18 }}></CrownFilled>}
                            arrow="horizontal"
                            platform="android"
                            onClick={() => { }}
                            style={{ height: '50px' }}

                        >成为up主</Item>
                        <Link to='feedback'>
                            <Item
                                thumb={<MailFilled style={{ color: '#0984e3', fontSize: 18 }} />}
                                arrow="horizontal"
                                onClick={() => { }}
                                style={{ height: '50px' }}

                            >意见反馈</Item>
                        </Link>
                    </List>
                    <WhiteSpace size='lg'></WhiteSpace>
                    <List>
                        <Link to='login'>
                            <Item
                                thumb={<ApiFilled style={{ color: '#636e72', fontSize: 18 }} />}
                                extra={<LogoutOutlined></LogoutOutlined>}
                                onClick={() => { }}
                                style={{ height: '50px' }}

                            >退出登录</Item>
                        </Link>
                    </List>
                </AppPage>

            </div>
        );
    }
}
